
function homeService($http){
    var hs = this;

    function getAllPassMerchantsFromA(callback){
        console.log("enter homeService getAllPassMerchantsFromA");
        $http.get("/o2o/client/home").then(function(res){
            console.log("从后端获取到的getAllPassMerchantsFromA " + res.data);
            callback(null, res.data);
        });
    }

    function getMerchantsByFoodType(type, callback){
        console.log("getMerchantsByFoodType__"+type);
        $http.get("/o2o/client/foodType/"+type+"/merchants").then((res) => {
            callback(null, res.data);
        })
    }

    return {
        getAllPassMerchantsFromA: getAllPassMerchantsFromA,
        getMerchantsByFoodType: getMerchantsByFoodType
    }
}

module.exports = homeService;